#include <iostream>
#include <cmath>
using namespace std;

const int N = 17;
double ans = 1e9;
int n;
double x[N], y[N];
double dis[N][N]; //dis[i][j]表示从第i个奶酪到第j个奶酪的距离
double dp[70000][20]; //2^16,第一个位置表示状态编码,第二个位置表示达到当前状态，最后一个吃掉的奶酪编号
int ind[70000]; //权值映射

double d(int i, int j) {
	return sqrt((x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])* (y[i] - y[j]));
}

void dfs(int t, int now, double s) {
	if (t == 0) { //吃掉了所有奶酪
		if (s < ans) ans = s;
		return;
	}
	for (int k = t; k; k -= (k & -k)) {
		int to = ind[k & -k], next_t = t - (1 << to);
		double l = s + dis[now][to];
		if (dp[next_t][to] != 0 && dp[next_t][to] <= l) continue;
		
		
		dp[next_t][to] = l;
		if (ans <= l) continue;

		dfs(next_t, to, l);
	}
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	x[0] = y[0] = 0; //小老鼠位置
	for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];

	for (int i = 0; i <= n; i++)
	{
		for (int j = i; j <= n; j++) 
			dis[i][j] = dis[j][i] = d(i, j);
	}
	for (int k = 1, i = 0; i <= N; i++, k *= 2)ind[k] = i; //权值到下标映射
	dfs((1 << (n + 1)) - 2, 0, 0); //当前位置状态码，所在奶酪下标，到达状态所走总路程
	printf("%.2lf\n", ans);
	return 0;
}